/*
 * @Descripttion:
 * @version: 1.0.0
 * @Author: Shentong
 * @Date: 2021-04-09 12:34:34
 * @LastEditors: Shentong
 * @LastEditTime: 2021-11-22 18:56:17
 */
/**
 * @description 此页面暂时不用： TODO:
 */
// eslint-disable-next-line @typescript-eslint/no-use-before-define
 import React, { useEffect, useState } from "react";
 import Taro from '@tarojs/taro'

 import { View, Image, Button, Text } from "@tarojs/components";

 import styles from './index.module.scss'

 const downLoadQrcodeUrl = 'https://www.jlshuangcheng.com/images/01.png'
 const downLoadLink = 'https://www.jlshuangcheng.com/customer.html'

 const DownLoadApp = () => {
    const lookimg = () => {
      Taro.previewImage({
        current: '', // 当前显示图片的http链接
        urls: [downLoadQrcodeUrl] // 需要预览的图片http链接列表
      })
    } 

    const downLoadLinkClick = () => {
      Taro.setClipboardData({
        data: downLoadLink,
        success: function () {
          // Taro.getClipboardData({
          //   success: function (res) {
          //     console.log(res.data) // data
          //   }
          // })
        }
      })
    }

   return (
     <View className={styles.downLoadApp}>
       <View className={styles.item}>
         {/* <View className={styles.title}>方法一：</View> */}
        <View className={styles.tips}>方法一：点击图片放大后，长按保存二维码，识别二维码下载App。</View>
        <View className={styles.qrcodeImg} onClick={lookimg}>
            <Image className={styles.img} src={downLoadQrcodeUrl}></Image>
        </View>
        {/* <Button type='primary' openType='contact'>在线咨询</Button> */}
       </View>
       <View className={styles.item}>
        <View className={styles.tips}>方法二：复制以下链接，在浏览器中打开。</View>
        <View className={styles.link}>
          <Text>www.jlshuangcheng.com/customer.html</Text>
          <View className={styles.copyBtn} onClick={downLoadLinkClick}>复制链接</View>
        </View>
       </View>
     </View>
   );
 }

 export default DownLoadApp
